home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Atari Mega Archive 2
/
Atari Mega Archive CD - Volume 2.iso
/
8bit
/
cislib_b
/
pspic3.xmo
< prev
next >
Wrap
Text File
|
1995-04-22
|
14KB
|
1 lines
DEFINE clear="0", intact="1",¢ is="=", free="0", taken="1",¢ adisk="0", pdisk="1"¢;Print Shop Screen Magic¢;and Graphic Library ¢;File conversion utility¢;by Mike Collins¢;ver. 3¢;10/13/85¢;בנלסחכדáגחפדבקכךáהפנלáגחצי«áááá¢;בנלסחכדáחמáבIJצדáצדמצחקחשדáלנגד«¢BYTE ramtop=106, hitop, lotop,¢picflag=[0], over, margin=82, vtab=84,¢htab=85¢BYTE ARRAY fname, filename,¢ vtocsec(128), vtoc,¢ mask=[128 64 32 16 8 4 2 1],¢ dirbuf(129), psid=['P 'R 'I]¢CARD smem=88, screen, dlhi, xpos, ypos¢TYPE directory=[BYTE n0,n1,n2,n3,n4,¢n5,n6,n7,n8,n9,na,nb,nc,nd,ne,nf¢CARD startsec, PA, bytes]¢directory POINTER file¢;************************************¢;Burst (Block) I/O routines to do¢;quick disk I/O, utilizing a call to¢;CIO¢;************************************¢¢PROC CIO=$E456(BYTE areg,xreg)¢¢;************************************¢¢CARD FUNC Burst(BYTE chan,mode,¢ CARD addr,buflen)¢¢ TYPE IOCB=[BYTE id,num,cmd,stat¢ CARD badr,padr,blen¢ BYTE a1,a2,a3,a4,a5,a6]¢¢ IOCB POINTER iptr¢¢ chan==&$07¢ iptr=$340+(chan LSH 4)¢ iptr.cmd=mode¢ iptr.blen=buflen¢ iptr.badr=addr¢ CIO(0,chan LSH 4)¢RETURN(iptr.stat)¢;************************************¢CARD FUNC BGet(BYTE chan¢ CARD addr,len)¢ CARD temp¢ temp=Burst(chan,7,addr,len)¢RETURN (temp)¢;************************************¢BYTE FUNC BPut(BYTE chan¢ CARD addr,len)¢BYTE stat¢ stat=Burst(chan,11,addr,len)¢RETURN(stat)¢;************************************¢PROC DISKINV=$E453()¢;************************************¢BYTE FUNC resdisk(BYTE drv, cmd¢ CARD buf, sec)¢¢TYPE DCB=[BYTE sbi, dnum, com, stat¢ CARD addr, to, cnt, secnum]¢DCB POINTER disk¢disk=$300¢disk.dnum=drv¢disk.com=cmd¢disk.addr=buf¢disk.secnum=sec¢DISKINV() ¢RETURN(disk.stat) ¢;************************************¢BYTE FUNC GetSec(BYTE drv¢ CARD buf, sec)¢BYTE stat¢stat=resdisk(drv, 'R, buf, sec)¢RETURN(stat)¢;************************************¢BYTE FUNC PutSec(BYTE drv¢ CARD buf, sec)¢BYTE stat¢stat=resdisk(drv, 'W, buf, sec)¢RETURN(stat)¢;************************************¢PROC shift(CARD buffer)¢PokeC($CB,buffer)¢[24 160 0 8 40 177 203 106 ¢ 145 203 8 200 192 12 208 244 ¢ 40]¢RETURN¢;************************************¢PROC overlay(CARD to, from, length)¢BYTE POINTER pointto, pointfrom¢CARD count¢FOR count=0 TO length-1¢DO¢pointto=count+to pointfrom=count+from¢pointto^=pointto^ OR pointfrom^¢OD¢RETURN¢;************************************¢PROC vdelay()¢BYTE jiffy, clock=20¢jiffy=clock ;This loop ensures¢DO ;that 1 vbl interupt¢UNTIL jiffy#clock;will occur. All ¢OD ;hardware registers¢RETURN ;will be updated.¢;************************************¢BYTE FUNC uppercase(BYTE chr)¢IF chr>='a AND chr<='z THEN¢ RETURN(chr-$20)¢FI¢RETURN(chr)¢;************************************¢PROC nobreak() ;disable break key¢Poke(16,64) Poke(53774,64)¢RETURN¢;************************************¢PROC ercheck(BYTE ernum)¢IF ernum#1 ;error check routine¢THEN ;if ernum<>1 then report¢ramtop=lotop ;error to user¢Graphics(0) nobreak()¢vdelay()¢Position(8,11) Print("ERROR #")¢PrintBE(ernum)¢Position(8,13) Print("Press any key")¢ernum=1¢GetD(7)¢FI¢RETURN¢;************************************¢PROC promptps()¢ramtop=lotop¢Graphics(0) nobreak()¢Put(253) ;bell¢Position(4,8) Print("Please remove disk from drive 1")¢Position(4,10) Print("and insert PRINT SHOP data disk.")¢Position(12,12) PrintE("ס≥σ≤≤áβ∈∙áδσ∙«")¢GetD(7)¢RETURN¢;************************************¢PROC promptpic()¢ramtop=lotop¢Graphics(0) nobreak()¢Put(253) ;bell¢Position(4,8) Print("Please remove disk from drive 1")¢Position(9,10) Print("and insert .PIC disk.")¢Position(12,12) PrintE("ס≥σ≤≤áβ∈∙áδσ∙«")¢GetD(7)¢RETURN¢;************************************¢PROC init()¢vtoc=vtocsec+32¢Close(7)¢Open(7,"K:",4,0)¢hitop=ramtop¢Graphics(24) nobreak()¢screen=smem¢lotop=Peek(561)-1 dlhi=PeekC(560)¢Error=ercheck¢filename="D1: "¢RETURN¢;************************************¢PROC showscreen(BYTE option)¢BYTE mode, jiffy, clock=20¢;clear screen if option=0¢ramtop=hitop ;set ramtop for gr.8¢IF option=clear THEN¢ Graphics(24)¢ nobreak()¢ picflag=0 ;erase picture¢ELSE¢PokeC(560,dlhi)¢FI¢vdelay()¢RETURN¢;************************************¢PROC makename(BYTE ARRAY name)¢BYTE x, i, temp¢name(0)=14¢name(1)='D name(2)=':¢name(15)=155¢name(14)=name(13)¢name(13)=name(12)¢name(12)=name(11)¢name(11)='.¢FOR x=1 TO 10¢ DO¢ WHILE name(x)=' ¢ DO¢ FOR i=x TO 15 ¢ DO¢ name(i)=name(i+1)¢ OD¢ OD¢ OD¢FOR x=1 TO 14¢DO¢ IF name(x)=155¢ THEN name(0)=x-1¢ FI¢OD¢ IF name(name(0))='.¢ THEN name(0)==-1¢ FI¢ IF name(10)='. AND name(11)=' ¢ THEN name(0)=9¢ FI¢RETURN¢;************************************¢BYTE FUNC data_disk()¢BYTE x¢x=GetSec(1,dirbuf,361)¢IF x#1¢THEN RETURN(x)¢FI¢ FOR x=0 TO 2¢ DO¢ IF dirbuf(x)#psid(x)¢ THEN RETURN(adisk)¢ FI¢ OD¢RETURN(pdisk)¢;************************************¢BYTE FUNC menu()¢BYTE selection¢ramtop=lotop ;put menu under screen¢Graphics(0) nobreak()¢margin=11¢Position(8,0)¢Print("ס≥Θ∈⌠áצΦ∩≡áהΘ∮σáב∩∈÷σ≥⌠σ≥")¢Position(13,1)¢Print("áááá÷σ≥«áø«ãááá")¢Position(13,2)¢Print("Γ∙áל«ו«áב∩∮∮Θ∈≤")¢Position(13,3)¢PrintE("ááááõã»õø»ÕŒááá")¢vtab=9¢PrintE("1. Load PS File")¢PrintE("2. Load Atari File")¢PrintE("3. Save PS File")¢PrintE("4. Save Atari File")¢DO¢vtab=14 htab=margin¢Print("Select(1-4):")¢selection=GetD(7) selection==&127¢Put(selection)¢UNTIL selection>'0 AND selection<'5¢OD¢margin=2¢RETURN(selection)¢;************************************¢CARD FUNC psdir()¢BYTE x, stat, dstat ¢CARD sector¢dstat=data_disk()¢IF dstat=pdisk¢THEN¢ramtop=lotop¢Graphics(0) nobreak()¢PrintE("צסIJבד for next file, פדקרפמ to load")¢ PutE()¢ htab=6¢ PrintE("Filename File Type")¢ PutE()¢ FOR sector=362 TO 393¢ DO ;read¢ stat=GetSec(1,dirbuf+1,sector);directory¢ IF stat#1 THEN¢ ercheck(stat)¢ EXIT¢ FI¢ fname=dirbuf¢ FOR x=1 TO 4¢ DO¢ IF fname(1)=0 THEN RETURN(0) FI¢ fname(0)=15 file=fname+1¢ htab=6¢ Print(fname) ;print filenames¢ Print(" ")¢ IF file.bytes<641¢ THEN PrintE("Graphic")¢ ELSE PrintE("Screen Magic")¢ FI¢ IF GetD(7)=155 THEN¢ filename(1)='D¢ filename(2)=':¢ filename(0)=15¢ MoveBlock(filename+3,fname+1,8)¢ RETURN(file.startsec)¢ FI¢ fname==+32¢ OD¢ OD¢ELSEIF dstat=adisk¢THEN¢promptps()¢ELSE ercheck(dstat)¢FI¢RETURN(0)¢;************************************¢CARD FUNC dir()¢BYTE dstat¢BYTE ARRAY name(20)¢dstat=data_disk()¢IF dstat=adisk¢THEN¢Graphics(0) nobreak()¢PrintE("צסIJבד for next file, פדקרפמ to load")¢ PutE()¢Close(1)¢Open(1,"D:*.*",6,0) ;read directory¢DO¢InputSD(1,name)¢ IF name(14)='O THEN EXIT FI¢htab=10¢PrintE(name)¢ IF GetD(7)=155¢ THEN¢ makename(name)¢ EXIT FI¢OD¢Close(1)¢ELSEIF dstat=pdisk¢THEN¢promptpic()¢ELSE ercheck(dstat)¢FI¢RETURN(name)¢;************************************¢BYTE FUNC getcoord()¢BYTE option¢ramtop=lotop¢Graphics(0) nobreak()¢xpos=0 ypos=0¢Position(8,5) Print("This is a graphic file.")¢DO¢Position(6,7) Print("Enter X coordinate(0-232): ~~~~~~")¢xpos=InputC()¢UNTIL xpos<233¢OD¢DO¢Position(6,9) Print("Enter Y coordinate(0-140): ~~~~~~")¢ypos=InputC()¢UNTIL ypos<141¢OD¢ IF picflag=1¢ THEN¢ DO¢ Position(6,11) Print("בlear or דxisting Screen?: ~~~~")¢ option=GetD(7) option==&127¢ option=uppercase(option)¢ UNTIL option='C OR option='E¢ OD Put(option)¢ IF option='E¢ THEN¢ DO¢ Position(6,13) Print("Overlay(Y/N)?:")¢ over=GetD(7) over==&127¢ over=uppercase(over)¢ UNTIL over='Y OR over='N¢ OD Put(over)¢ FI¢ ELSE option='C over='N¢ FI¢ IF option='C¢ THEN option=clear¢ ELSE option=intact¢ FI¢RETURN(option)¢;************************************¢BYTE FUNC loadps(CARD sector) ;return error #¢BYTE stat¢CARD offset, seccnt¢offset=0¢showscreen(clear)¢FOR seccnt=1 TO 61¢DO¢stat=GetSec(1,screen+offset,sector)¢ IF stat#1 THEN EXIT FI¢offset==+126¢sector=PeekC(screen+offset);sector link¢IF sector=0 OR sector>720¢THEN EXIT FI¢OD¢ercheck(stat)¢picflag=1¢GetD(7)¢RETURN(stat)¢;************************************¢BYTE